library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;

package pack_uart is
  function parite(v : std_logic_vector) return std_logic;
end pack_uart;

package body pack_uart is

  function parite(v : std_logic_vector) return std_logic is

    variable p : std_logic := '0';

    begin

    for i in v'range loop
      p := p xor v(i);
    end loop;

    return p;
  end parite;

end pack_uart;
